package netty.model;

import java.nio.channels.Channel;
import java.util.HashMap;
import java.util.Map;

/**
 * @author shkstart
 * @create 2019-11-15 21:18
 */
public class UserChannelMap {
    private  static Map<String, Channel> channelMap=new HashMap<>();

    /**
     * 建立useId和channel之间的联系
     * @param userId
     * @param channel
     */
    public static void put(String userId,Channel channel){
        channelMap.put(userId,channel);
    }

    /**
     * 获取用户的channel
     * @param userId
     * @return
     */
    public static Channel get(String userId){
        return  channelMap.get(userId);
    }



}
